﻿{include file="common/top"}

<div id="page-wrapper">
    <div id="page-inner">
        <div class="row">
            <div class="col-md-12">
                <h1 class="page-head-line">会员列表</h1>
                <h1 class="page-subhead-line"></h1>

            </div>
        </div>
        <!-- /. ROW  -->
        <div class="row">
            <div class="col-md-6 col-sm-6 col-xs-12">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        会员管理
                    </div>
                    <div class="panel-body">

                        <form method="post" action="" id="listform">
                            <div class="panel admin-panel">
                                <div class="panel-head"><strong class="icon-reorder"> 会员列表</strong>
                                    <a class="button border-red" href="/admin/member/add"><span
                                            class="icon-trash-o"></span> 添加会员</a>
                                    <table class="table table-hover text-center">
                                        <tr>
                                            <th>ID</th>
                                            <th>会员账号</th>
                                            <th>真实姓名</th>
                                            <th>性别</th>
                                            <th>余额</th>
                                            <th>所属代理</th>
                                            <th>交易</th>
                                            <th>创建时间</th>
                                            <th>操作</th>
                                        </tr>

                                        {volist name="member" id="vo"}
                                        <tr>
                                            <td>{$vo.id}</td>
                                            <td> {$vo.username}</td>
                                            <td>{$vo.realname}</td>
                                            <td>{$vo.gender==''?'未知':($vo.gender=='1'?'男':'女')}</td>
                                            <td>{$vo.user_money}</td>
                                            <td>{$vo.daili==''?'未设置':$vo.daili}</td>
                                            <td>{$vo.status=='1'?'正常':禁止}</td>
                                            <td>{$vo.created_at|date="Y-m-d H:i:s"}</td>
                                            <td>
                                                <div class="button-group">
                                                    <!--                        <a class="button border-main" href="add.html"><span class="icon-edit"></span> 修改</a>-->

                                                    <a class="button border-red" href="/admin/member/edit?id={$vo.id}"
                                                       onclick=" "><span
                                                            class="icon-trash-o"></span> 修改</a>
                                                    <a class="button border-red" href="javascript:;"
                                                       onclick="del({$vo.id})"><span
                                                            class="icon-trash-o"></span> 删除</a>
                                                </div>
                                            </td>
                                        </tr>
                                        {/volist}

                                        <tr>
                                            <td colspan="8">
                                                <div class="pagelist"><a href="">上一页</a> <span
                                                        class="current">1</span><a href="">2</a><a
                                                        href="">3</a><a href="">下一页</a><a href="">尾页</a></div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                        </form>

                    </div>
                </div>
            </div>
        </div>
        <!-- /. PAGE INNER  -->
    </div>

    <script type="text/javascript">
        function del(id) {
            layer.confirm('你确定要删除吗', function () {
                $.ajax({
                    type: 'delete',
                    url: '/admin/member/' + id,
                    datetype: 'json',
                    success: function (data) {
                        if (data.status == 'success') {
                            layer.msg(data.msg), {icon: 1};
                        } else {
                            layer.mag(data.msg), {icon: 2};
                        }
                        location.href = '/admin/member/list';
                    }
                })
            })
        }
    </script>
    {include file="common/out"}

